<%--
  Created by IntelliJ IDEA.
  User: 12
  Date: 2023/3/1
  Time: 17:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%--引入标准标签库--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>购物车列表的商品</title>
    <%--1. 引入jquery--%>
    <script src="/webjars/jquery/3.6.0/jquery.min.js"></script>
    <%--2. 引入bootstrap的CSS样式--%>
    <link rel="stylesheet" href="/webjars/bootstrap/3.4.1/css/bootstrap.min.css">
    <%--3. 引入bootstrap的js库--%>
    <script src="/webjars/bootstrap/3.4.1/js/bootstrap.min.js"></script>
    <style>
        .container{
            margin-top: 10px;
        }
        .table{
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <h3>商品列表</h3>
                </h3>
            </div>
            <table class="table table-hover table-striped">
                <tr>
                    <td>商品ID</td>
                    <td>商品名称</td>
                    <td>单价</td>
                    <td>数量</td>
                    <td>小计(元)</td>
                    <td>是否移出</td>
                </tr>
                <c:forEach var="cart" items="${cart.maps}">
                    <tr>
                        <td>${cart.value.product.pid}</td>
                        <td>${cart.value.product.pname}</td>
                        <td>${cart.value.product.price}</td>
                        <td>${cart.value.num}</td>
                        <td>${cart.value.product.price * cart.value.num}</td>
                        <td>
                            <a href="/cart?cmd=remove&pid=${p.value.pid}" class="btn btn-danger btn-sm">移出</a>
                        </td>
                    </tr>
                </c:forEach>
            </table>
            <%--这里放所有的商品列表--%>
            <div class="panel-footer text-right">
                <a href="/index.jsp" class="btn btn-primary btn-sm">继续挑选</a>
                百年智的商品
            </div>
        </div>
    </div>
</body>
</html>
